package cn.edu.ctbu.lab.core;

import cn.edu.ctbu.lab.aspect.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/error", "/login"
                        , "/dist/**", "/css/**", "/js/**", "/img/**", "/plugins/**",
                        "/pages/**", "/api/login/student");

    }
}
